1. Field of the Invention
The present invention relates to a video coding apparatus and, more particularly, to a video coding apparatus for performing coding by using motion compensatory prediction of a digital video signal.
2. Description of the Related Art
Among highly efficient coding systems for coding sequentially input video signals in a fewer code quantity, coding systems by the use of the motion and correlation between video pictures of video signals include motion compensatory prediction coding which decodes to reproduce a video picture coded in the past and uses motion information per small block derived from the video picture. One example of the conventional motion compensatory prediction coding is illustrated in FIG. 1.
In FIG. 1, when an input video signal 1 of a first screen is input, each of switches is controlled to be connected onto a side (1) by a coding mode control section 12, and the input video signal 1 is input directly into an orthogonal transform unit 3 in order to achieve high coding efficiency. The input video signal 1 is orthogonally transformed by using DCT (discrete cosine transform) or the like in the orthogonal transform unit 3. An orthogonal transform coefficient is quantized by a quantizer 4. The resultant quantization coefficient is converted into a variable length code such as a Huffman code by a first variable length encoder 5, and then, is input into a video duplexer 15.
In the meantime, the quantization coefficient input into an inverse quantizer 6 is inversely quantized, and then, video picture data is restored by an inverse orthogonal transform unit 7. The restored video picture data is stored in a frame memory 9. Moreover, coded data 13 transmitted from the first variable length encoder 5 and quantization information 18 transmitted from the quantizer 4 is duplexed by the video duplexer 15, to be output as a coded video data output 16.
When another input video signal 1 of a next screen is input, each of the switches is controlled to be connected to a contact on a side (2) by the coding mode control section 12, so that the input video signal 1 is input into a predictive signal subtraction section 2 and a motion compensator 10. In the motion compensator 10, a motion vector is detected based on the input video signal 1 and a reference video picture input from the frame memory 9, and then, is input into a position shifter 11 and a second variable length encoder 14. In the second variable length encoder 14, motion vector information is converted into a variable length code such as a Huffman code, thus to be input into the video duplexer 15.
In the position shifter 11, a video signal designated by the motion vector is extracted from the frame memory 9, and thereafter, is output as a motion compensatory predictive signal to the predictive signal subtraction section 2 and a local decoding addition section 8. In the predictive signal subtraction section 2, the motion compensatory predictive signal is subtracted from the input video signal 1, so that a prediction error thereof is coded. A prediction error signal is orthogonally transformed by using DCT (discrete cosine transform) or the like in the orthogonal transform unit 3 in order to achieve high coding efficiency. The signal quantized by the quantizer 4 is converted into a variable length code such as a Huffman code in the first variable length encoder 5. In order to use the same predictive signal as that on a decoding side, the quantization coefficient obtained by the quantizer 4 is inversely quantized by the inverse quantizer 6, and then, the prediction error signal is locally decoded by the inversely orthogonal transform unit 7. Furthermore, the motion compensatory predictive signal is added with the prediction error signal decoded by the local decoding addition section 8, and then, is stored in the frame memory 9.
In view of convenience of highly efficient coding and decoding reproduction, the video picture is coded by combining three kinds of video coding systems for P, B and I frames.
A minimum unit of video pictures, which are formed by combining the three kinds of video coding systems and can be decoded independently of each other, is referred to as “a GOP (a Group of Pictures)”. The combination of the coding systems is referred to as “a GOP structure”. A frame first coded inside one GOP is intra-frame coding (an I frame). FIG. 2 illustrates an example of a GOP. In FIG. 2, the number of frames included in one GOP is referred to as a GOP size, and an interval between P frames or between an I frame and a P frame is referred to as a predictive frame interval.
An I frame inserting interval has been conventionally constant irrespective of the feature of the input video picture: namely, the GOP size has been fixed, so that intra-frame coding has been forcibly carried out per predetermined number of frames. Consequently, the I frame has been inserted even in the case where the input video picture has the high correlation with the reference video picture and coding efficiency can be enhanced by using inter-frame prediction coding.
As for the predictive frame interval, a predictive frame interval of highest coding efficiency depends on the feature of the video picture. For example, a video picture of a swift motion can be predicted from the reference video picture with high efficiency by shortening the predictive frame interval, thus enhancing the coding efficiency. To the contrary, in the case of little variation, the predictive frame interval is prolonged, thereby enhancing the coding efficiency. However, since the predictive frame interval is fixed to about 0.1 second irrespectively of the feature of the video picture in the conventional system, the coding efficiency can not be enhanced.
Furthermore, in a video picture compression system capable of coding by either a frame structure or a field structure, there can be used either coding by “the field structure” in which one video picture to be coded is coded in a manner corresponding to one field video picture or coding by “the frame structure” in which one video picture to be coded is coded in a manner corresponding to one interlaced frame video picture. However, in the prior art, it is previously designated from the outside as to which is selected out of the frame structure and the field structure before the video picture is coded, so that the video picture to be input is coded by fixedly using the designated structure, thereby outputting coded data. That is, the coding is carried out by the fixed picture structure irrespective of the feature of the video picture.
Therefore, even in the case of coding a video picture of a swift motion in which the coding efficiency can be enhanced by adopting the field structure, the coding by the frame structure is continued if the frame structure is previously designated as the coding picture structure, resulting in degradation of the coding efficiency. To the contrary, in the case where the coding by the field structure is previously designated, the coding efficiency cannot be enhanced since the field structure is fixedly used even if the coding efficiency can be enhanced by the frame structure.
Additionally, in the case where it is not found whether the input video picture is an interlaced video picture or a non-interlaced video picture, high coding efficiency can be achieved by a 2-step system in which it is previously discriminated by some method whether or not the input video picture is an interlaced video picture, and thereafter, the picture structure is switched from the outside at the time of coding based on the discrimination information. Such a 2-step system is unavailable on the assumption of coding in real time.